package com.rpcdemo.client;

import com.rpcdemo.entity.Contributor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;


/**
 * create by yongli on 2022-03-17 08:21
 * 这个只有name,
 * name值http请求时只写目标服务名 xx-user即可，配置https需要加上https//前缀，以及，
 * configuration属性添加上述配置类FeignHttpsConfig.Class
 * 20.205.243.168
 * 使用这个name好像又问题
 * com.netflix.client.ClientException: Load balancer does not have available server for client: 20.205.243.168
 */
@FeignClient(name = "https://20.205.243.168")
public interface GithubClient2 {
    @GetMapping("/repos/{owner}/{repo}/contributors")
    List<Contributor> contributors(@PathVariable("owner") String owner, @PathVariable("repo") String repository);
}
